package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(32)"`
}
type House struct {
	gorm.Model
	HouseName string `gorm:"type:varchar(30)"`
	Address   string `gorm:"type:varchar(32)"`
}

func (h *House) HouseList(db *gorm.DB) error {
	err = db.Find(h).Error
	return err

}
func (h *House) HouseShow(db *gorm.DB, id int) error {
	err = db.Where("id=?", id).First(h).Error
	return err
}
